package com.jtx.miaoah2.Controller;

import com.jtx.miaoah2.Common.BaseResponse;
import com.jtx.miaoah2.Model.user.DO.SkUser;
import com.jtx.miaoah2.Model.user.DTO.SkUserDto;
import com.jtx.miaoah2.Service.SkUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 季台星
 * @Date 2023 07 23 14 03
 */
@RestController
@RequestMapping("/api/v1/login")
public class SkLoginController {

    @Autowired
    private SkUserService skUserService;

    @PostMapping("/in")
    public BaseResponse userLogin(@RequestBody SkUserDto userDto){
        return skUserService.login(userDto);
    }
    @PostMapping("/register")
    public BaseResponse register(@RequestBody SkUserDto skUserDto){
        return skUserService.register(skUserDto);
    }
}
